<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>易买网 - 首页</title>
<link type="text/css" rel="stylesheet" href="<%=path%>/resources/css/style.css" />
<script type="text/javascript" src="<%=path%>/resources/scripts/function.js"></script>
</head>
<body>
<div id="header" class="wrap">
	<div id="logo"><img src="<%=path%>/resources/images/logo.gif" /></div>
	<div class="help"><a href="<%=path%>/main/shop" class="shopping">购物车</a><a href="<%=path%>/login">登录</a><a href="<%=path%>/main/register">注册</a><a href="<%=path%>/main/cancel">注销</a></div>
	<div class="navbar">
		<ul class="clearfix">
			<li class="current"><a href="<%=path%>/main/index">首页</a></li>
			<c:forEach var="indexCat" items="${categoriesIndex }">
			<li><a href="<%=path%>/main/${indexCat.id }/product">${indexCat.name }</a></li>
			</c:forEach>
		</ul>
	</div>
</div>
<div id="childNav">
	<div class="wrap">
		<ul class="clearfix">
		   <c:forEach var="seCat" items="${categoriesSeconde }">
		   <li><a href="<%=path%>/main/${seCat.id }/product">${seCat.name }</a></li>
		   </c:forEach>
		</ul>
	</div>
</div>
<div id="main" class="wrap">
	<div class="lefter">
		<div class="box">
			<h2>商品分类</h2>
			<dl>
			<c:forEach var="navMap" items="${navigationMap }">
			<dt>${navMap.key }</dt>
		    <c:set value="${navMap.value }" var="subItem"/>  
            <c:forEach items="${subItem }" var="var">
            <dd><a href="<%=path%>/main/${var.id }/product"> ${var.name }</a></dd>
            </c:forEach>  
            </c:forEach>
			</dl>
		</div>
		<div class="spacer"></div>
		<div class="last-view">
			<h2>最近浏览</h2>
			<dl class="clearfix">
				<dt><img src="<%=path%>/resources/images/product/0_tiny.gif" /></dt>
				<dd><a href="product-view.html">法国德菲丝松露精品巧克力500g/盒</a></dd>
				<dt><img src="<%=path%>/resources/images/product/0_tiny.gif" /></dt>
				<dd><a href="product-view.html">法国德菲丝松露精品巧克力500g/盒</a></dd>
			</dl>
		</div>
	</div>
	<div class="main">
		<div class="price-off">
			<h2>今日特价</h2>
			<ul class="product clearfix">
			    <c:forEach var="repr" items="${recommendProducts }">
				<li>
					<dl>
						<dt><a href="<%=path%>/main/product/${repr.epId }/show" target="_blank"><img src="<%=path%>/resources/images/product/${repr.fileName }" /></a></dt>
						<dd class="title"><a href="product-view.html" target="_blank">${repr.description }</a></dd>
						<dd class="price">${repr.price }</dd>
					</dl>
				</li>
				</c:forEach>
			</ul>
		</div>
		<div class="side">
			<div class="news-list">
				<h4>最新公告</h4>
				<ul>
					<c:forEach var="notice" items="${notices}">
					<li><a href="<%=path %>/main/noticeView?id=${notice.id}" target="_blank">${notice.title }</a></li>
					</c:forEach>
				</ul>
			</div>
			<div class="spacer"></div>
			<div class="news-list">
				<h4>新闻动态</h4>
				<ul>
				    <c:forEach var="news" items="${news }">
					<li><a href="<%=path %>/main/newsView?id=${news.id}" target="_blank">${news.title }</a></li>
					</c:forEach>
				</ul>
			</div>
		</div>
		<div class="spacer clear"></div>
		<div class="hot">
			<h2>热卖推荐</h2>
			<ul class="product clearfix">
			   <c:forEach var="hotPro" items="${hotProducts }">
				<li>
					<dl>
						<dt><a href="<%=path%>/main/product/${hotPro.epId }/show" target="_blank"><img src="<%=path%>/resources/images/product/${hotPro.fileName }" /></a></dt>
						<dd class="title"><a href="<%=path%>/main/product/${hotPro.epId }/show" target="_blank">${hotPro.description }</a></dd>
						<dd class="price">${hotPro.price }</dd>
					</dl>
				</li>
				</c:forEach>
			</ul>
		</div>
	</div>
	<div class="clear"></div>
</div>
<div id="footer">
	Copyright &copy; 2017 爱苗科技 All Rights Reserved. 皖ICP证000001号
</div>
</body>
</html>
